from django.db import models

# Create your models here.
from user.models import UserModel

class RealNameAuthentication(models.Model):
    # 用户ID，假设是外键关联到User模型
    user_id = models.ForeignKey(UserModel, on_delete=models.CASCADE, verbose_name='用户ID')
    # 人脸识别图片地址
    face_recognition_image = models.ImageField(upload_to='face_recognition/', verbose_name='人脸识别图片')
    # 身份证图片地址
    id_card_image = models.ImageField(upload_to='id_card/', verbose_name='身份证图片')
    # 姓名
    name = models.CharField(max_length=100, verbose_name='姓名')
    # 证件号
    identification_number = models.CharField(max_length=18, verbose_name='证件号')
    # 是否通过认证
    is_approved = models.BooleanField(default=False, verbose_name='是否通过')

    def __str__(self):
        return self.name

    class Meta:
        db_table = 'real_name_authentication'
        verbose_name_plural = '实名认证'
